Skip to content

ci: lint in the pull request workflow - #26

Merged
christiangda merged 1 commit into
mainfrom
ci/lint-in-the-pr-workflow
Oct 24, 2026
Merged

christiangda merged 1 commit into
mainfrom
ci/lint-in-the-pr-workflow

Conversation

@christiangda

Copy link
Copy Markdown
Contributor

What was wrong

.golangci.yaml enables errcheck, ineffassign, staticcheck and unused, and nothing ran them. The pull request workflow builds, tests and measures coverage only, so a finding could merge.

What changes

  • A lint step in pr.yaml, before the tests. It runs golangci-lint run ./... with .golangci.yaml, and writes the report to the step summary.
  • Pinned to v2.15.0, as the coverage tool is pinned. The job builds with the Go of go.mod (1.26, GOTOOLCHAIN=local), so a golangci-lint whose go directive is newer does not install.
    • v2.15.0 is the newest release, and it declares go 1.26.0.
    • The comment says to raise it together with the go directive.
  • DEVELOPMENT_GUIDELINES.md names the linter in its Stack list.

How it was checked

  • Built with Go 1.26.0: golangci-lint v2.15.0 installs and reports 0 issues on main. The test files carry no build tag, so the default run covers them.
  • The step fails a finding: run through the workflow's own shell (bash -eo pipefail) and its | tee pipe, with a probe file holding two ineffective assignments, it exits 1 (3 issues). On the clean tree it exits 0.
  • actionlint passes on the workflow.

🤖 Generated with Claude Code

.golangci.yaml enabled errcheck, ineffassign, staticcheck and unused, and
nothing ran them: the pull request workflow built, tested and measured
coverage only. A lint step now runs golangci-lint with that file, pinned
to v2.15.0 as the coverage tool is pinned: the job builds with the Go of
go.mod (1.26, GOTOOLCHAIN=local), and v2.15.0 is the newest release whose
go directive (1.26.0) that Go installs. The step's pipe fails the job on a
finding (the workflow's shell is bash with pipefail).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@christiangda christiangda self-assigned this Oct 24, 2026
@christiangda
christiangda merged commit 78f42d3 into main Oct 24, 2026
1 check passed
@christiangda
christiangda deleted the ci/lint-in-the-pr-workflow branch October 24, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant